package com.xd.hbsys.windmap;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WindmapController {


    @Autowired
    private WindmapService wmService;

    @RequestMapping(value = "/windmap/list")
    @ResponseBody
    public String windmap_list(
            @RequestParam(value = "type") String type) {

        if (type.equals("real")) {


            return wmService.queryReal();
        } else if (type.equals("fore")) {
            return wmService.queryFore();
        }
        return "";
    }

    @RequestMapping(value = "/windmap/query")
    public String psquery(
            @RequestParam(value = "type") String type,
            @RequestParam(value = "time") String time) {

        if (type.equals("real")) {
            return wmService.queryReal(time);
        } else if (type.equals("fore")) {
            return wmService.queryFore(time);
        }
        return "";
    }
}
